/*
* @author : TF-BJ-C064
* @creation : 2014-6-26 下午8:32:23
* @description : 
*
*/

package com.service.impl;

import java.util.List;

import com.bean.TransactionRecord;
import com.dao.TransactionRecordDao;
import com.service.TransactionRecordService;
import com.util.GUtil;

public class TransactionRecordServiceImpl implements TransactionRecordService {
	
	TransactionRecordDao dao;

	@Override
	public Object get(Long id) throws Exception {
		return dao.findById(id);
	}

	@Override
	public List<Object> query(Object object) throws Exception {
		return dao.findAll();
	}

	@Override
	public String update(Object object) throws Exception {
		if(dao.merge((TransactionRecord)object)==null)
			return GUtil.FAILE;
		return GUtil.SUCCESS;
	}

	@Override
	public String delete(Long id, Integer flag) throws Exception {
		TransactionRecord tr = (TransactionRecord) this.get(id);
		if(tr!=null)
			return dao.delete(tr, flag);
		else
			return GUtil.FAILE;
	}

	@Override
	public List findByProperty(String propertyName, Object value)
			throws Exception {
		return null;
	}

	@Override
	public List findByExample(Object object) throws Exception {
		return null;
	}

	/**
	 * @return the dao
	 */
	public TransactionRecordDao getDao() {
		return dao;
	}

	/**
	 * @param dao the dao to set
	 */
	public void setDao(TransactionRecordDao dao) {
		this.dao = dao;
	}

	@Override
	public Object get(Integer id) throws Exception {
		return null;
	}

	@Override
	public String delete(Integer id, Integer flag) throws Exception {
		return null;
	}


}
